from abc import ABC, abstractmethod

class CApp(ABC):
    @abstractmethod
    def GetName(self):
        pass
    
    @abstractmethod
    def ShowLogo(self):
        pass
    
    @abstractmethod
    def RunPlatform(self):
        pass
    
class CHonorOfKings(CApp):
    def __init__(self, logo=None):
             self.mName = 'HonorOfKings'
             self.mLogo= logo
             #self.mPlatform=platform             
    def GetName(self):
        return self.mName 
        pass
    
    def ShowLogo(self):
        print('showLogo:',self.mName,'logo',self.mLogo,'platform',self.mPlatform)
        pass
    
    def RunPlatform(self,platform):
        #print(platform)
        self.mPlatform=platform
        pass

class CWeChat(CApp):
    def __init__(self, logo=None):
             self.mName = 'WeChat'
             self.mLogo= logo
             #self.mPlatform=platform             
    def GetName(self):
        return self.mName 
        pass
    
    def ShowLogo(self):
        print('showLogo:',self.mName,'logo',self.mLogo,'platform',self.mPlatform)
        pass
    
    def RunPlatform(self,platform):
        #print(platform)
        self.mPlatform=platform
        pass

class CPhone(ABC):
    @abstractmethod
    def InstallApp(self,AppObj):
        pass
    
    @abstractmethod
    def Uninstall(self,AppObj):
        pass
    
    @abstractmethod
    def EnterApp(self,AppObj):
        pass
    
    @abstractmethod
    def ShowAppList(self,AppObj):
        pass


class CMate40(CPhone):
    def __init__(self, name):
             self.mName = name
             self.mAppVec=[]
    #@abstractmethod
    def InstallApp(self,AppObj):
        print(self.mName,'InstallApp:',AppObj.GetName())
        AppObj.RunPlatform(self.mName)
        self.mAppVec.append(AppObj)        
        pass
    #@abstractmethod
    def Uninstall(self,AppObj):
        print(self.mName,'Uninstall:',AppObj.GetName())        
        self.mAppVec.remove(AppObj)
        pass
    
    #@abstractmethod
    def EnterApp(self,AppObj):
        print(self.mName,'EnterApp:')
        AppObj.ShowLogo()
        pass
    
    #@abstractmethod
    def ShowAppList(self):
        print(self.mName,'ShowAppList:')
        for  app in self.mAppVec:            
            print(app.GetName())

class CHonor30Pro(CPhone):
    def __init__(self, name):
             self.mName = name
             self.mAppVec=[]
    #@abstractmethod
    def InstallApp(self,AppObj):
        print(self.mName,'InstallApp:',AppObj.GetName())
        AppObj.RunPlatform(self.mName)
        self.mAppVec.append(AppObj)        
        pass
    #@abstractmethod
    def Uninstall(self,AppObj):
        print(self.mName,'Uninstall:',AppObj.GetName())        
        self.mAppVec.remove(AppObj)
        pass
    
    #@abstractmethod
    def EnterApp(self,AppObj):
        print(self.mName,'EnterApp:')
        AppObj.ShowLogo()
        pass
    
    #@abstractmethod
    def ShowAppList(self):
        print(self.mName,'ShowAppList:')
        for  app in self.mAppVec:            
            print(app.GetName())

theHonorOfKings=CHonorOfKings('Timi')

theWeChat=CWeChat('Earth')

thePhoneHonor30 = CHonor30Pro('Honor 30 Pro')

thePhoneHonor30.InstallApp(theHonorOfKings);

thePhoneHonor30.EnterApp(theHonorOfKings);

thePhoneHonor30.InstallApp(theWeChat);

thePhoneHonor30.EnterApp(theWeChat);

thePhoneHonor30.ShowAppList();

thePhoneHonor30.Uninstall(theWeChat);

thePhoneHonor30.ShowAppList();

print('*'* 30)

theMate40 = CMate40('Mate40')

theMate40.InstallApp(theHonorOfKings);

theMate40.EnterApp(theHonorOfKings);

theMate40.InstallApp(theWeChat);

theMate40.EnterApp(theWeChat);

theMate40.ShowAppList();

theMate40.Uninstall(theWeChat);

theMate40.ShowAppList();